import {Notify} from 'quasar';

export const userMessage = (type, message) => {
  const typeList = {
    info: {
      message: '提示',
      icon: 'info'
    },
    success: {
      message: '成功',
      icon: 'check'
    },
    error: {
      message: '错误',
      icon: 'clear'
    }
  };
  type = (Object.keys(typeList).indexOf(type) > -1) ? type : 'info';
  Notify.create({
    message: typeList[type].message,
    caption: message,
    icon: typeList[type].icon
  });
}
